#!/usr/bin/env bash
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
# This sub Makefile compiles libraries under this directory. This is designed to
# be used as a sub Makefile with tensorflow/contrib/makefile/Makefile.
# You can build targets in this file by including this sub makefile like:
# $ make -f tensorflow/contrib/makefile/Makefile TARGET=<target> \
# SUB_MAKEFILES=\
# $(pwd)/tensorflow/contrib/makefile/sub_makefiles/so/Makefile.in \
# (optional: NDK_ROOT=<ndk_root>) tensorflow-core.so

SO_NAME := tensorflow-core.so
SO_PATH := $(LIBDIR)$(SO_NAME)

$(SO_PATH): $(LIB_OBJS)
	@mkdir -p $(dir $@)
	$(CXX) $(CXXFLAGS) $(INCLUDES) \
	-o $@ $(LIB_OBJS) \
	$(LIBFLAGS) $(LDFLAGS) -shared $(LIBS)

$(SO_NAME): $(SO_PATH)
